import { Body, Controller, Put } from '@nestjs/common';
import { ApiOperation, ApiTags } from '@nestjs/swagger';
import { RateService } from './rate.service';
import { RateRatingDto } from '@/module/rate/rate.dto';
import { User } from '@/common/auth/user.decorator';
import { UserModel } from '@/module/user/user.model';

@Controller('/v1/mobile/rates')
@ApiTags('评分')
export class RateV1MobileController {
  constructor(private readonly rateService: RateService) {}

  @Put('/')
  @ApiOperation({ summary: '全部' })
  async rating(@Body() body: RateRatingDto, @User() user: UserModel): Promise<void> {
    await this.rateService.rating(body, user);
    return;
  }
}
